﻿using hou_elearning.DataAccess.Base;
using hou_elearning.Entity;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Collections;
using System.Web;

/// <summary>
/// Summary description for CustomBRL
/// </summary>
/// 
namespace hou_elearning.Custom
{
    public class DanhmuccauhoiCustomBRL : SqlProvider<DanhmuccauhoiEntity>
    {
        public DanhmuccauhoiCustomBRL()
        {
            
        }

        protected static void InitReader()
        {
            getFromReader = delegate(SqlDataReader dr)
            {
                DanhmuccauhoiEntity entity = new DanhmuccauhoiEntity();
                entity.PK_iDanhmuccauhoiID = Int16.Parse("0" + dr["PK_iDanhmuccauhoiID"].ToString());
                entity.sTendanhmuccauhoi = dr["sTendanhmuccauhoi"].ToString();
              
                return entity;
            };
        }

        public static bool bCheckDupByTennhom(String sTendanhmuccauhoi)
        {
            string cmdName = "spDanhmuccauhoi_GetByTendanhmuccauhoi";
            SqlParameter p = new SqlParameter("@sTendanhmuccauhoi", sTendanhmuccauhoi);
            DanhmuccauhoiEntity entity = GetOne(cmdName, p);
            if (entity != null)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}